<template>
  <div class="box">
    <h1>我的组件,{{ num }}</h1>
    <button @click="handleNum">+</button>
    <h2>{{ msg }}</h2>
    <h2>{{ reMsg }}</h2>
    <button @click="handleMsg">翻转字符串</button>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        num:10,
        msg:'Hello'
      }
    },
    methods: {
      handleNum() {
        this.num++
      },
      handleMsg(){
        this.msg = '走你'
      }
    },
    computed: {
      reMsg() {
        return this.msg.split('').reverse().join('')
      }
    },
  }
</script>

<style lang="scss" scoped>
//高级css语法
.box{
  border: 3px solid red;
}
</style>